SET(TARGET_NAME OsgLib)

#必须要有的宏定义

ADD_DEFINITIONS (-DOsgEidtorLibrary_EXPORT)
#ADD_DEFINITIONS (-DBOOST_ALL_NO_LIB)
#ADD_DEFINITIONS (-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
#ADD_DEFINITIONS (-DBOOST_TEST_DYN_LINK)

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include)
#INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../SwigOsgToLua/include)

LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib)

IF (CMAKE_CL_64)
ELSE()
ENDIF()
	INCLUDE_DIRECTORIES( ${OSG_DIR}/include )
	LINK_DIRECTORIES( ${OSG_DIR}/lib )


	
	INCLUDE_DIRECTORIES( ${OSG_WORKS_DIR}/include )
	LINK_DIRECTORIES( ${OSG_WORKS_DIR}/lib )
	
	INCLUDE_DIRECTORIES( ${LUA_DIR}/include)
	LINK_DIRECTORIES(${LUA_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${LIBXL_DIR}/include)
	#LINK_DIRECTORIES( ${LIBXL_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${BULLET_DIR}/include)
	#LINK_DIRECTORIES( ${BULLET_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${OSG_BULLET_DIR}/include )
	#LINK_DIRECTORIES( ${OSG_BULLET_DIR}/lib )
	

	#INCLUDE_DIRECTORIES( ${OMPL_DIR}/include)
	#LINK_DIRECTORIES( ${OMPL_DIR}/lib )
	#INCLUDE_DIRECTORIES( ${BOOST_DIR}/include)
	#LINK_DIRECTORIES( ${BOOST_DIR}/lib)


#库文件在debug下名字后面加d
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")


FILE(GLOB_RECURSE ThisTarget_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include/*.h")
FILE(GLOB_RECURSE ThisTarget_SRC_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/src/*.cpp")
source_group("include" FILES ${ThisTarget_INCLUDE_LIST})
source_group("src" FILES ${ThisTarget_SRC_LIST})

ADD_LIBRARY(${TARGET_NAME} SHARED ${ThisTarget_SRC_LIST} ${ThisTarget_INCLUDE_LIST})

SET(ADDITIONAL_LIBRARIES_RELEASE 
				#ompl.lib
				#boost_filesystem-vc100-mt-1_48.lib
				#boost_system-vc100-mt-1_48.lib
				#boost_thread-vc100-mt-gd-1_48.lib
				#boost_date_time-vc100-mt-1_48.lib
				#boost_program_options-vc100-mt-1_48.lib
				#boost_serialization-vc100-mt-1_48.lib

				
				osg.lib
				osgViewer.lib
				osgDB.lib						
				osgGA.lib
				osgText.lib
				osgUtil.lib
				osgShadow.lib
				osgSim.lib
				osgManipulator.lib
				OpenThreads.lib
				
				osgwTools.lib
				
				lua.lib
				

				#BulletCollision.lib
				#BulletDynamics.lib
				#HACD.lib
				#LinearMath.lib
				#osgbCollision.lib
				#osgbDynamics.lib
				#osgbInteraction.lib
				#osgwTools.lib
				#SwigOsgToLua.lib


				)   

SET(ADDITIONAL_LIBRARIES_DEBUG 
				#ompld.lib
				#boost_filesystem-vc100-mt-gd-1_48.lib
				#boost_system-vc100-mt-gd-1_48.lib
				#boost_thread-vc100-mt-gd-1_48.lib
				#boost_date_time-vc100-mt-gd-1_48.lib
				#boost_program_options-vc100-mt-gd-1_48.lib
				#boost_serialization-vc100-mt-gd-1_48.lib

				
				osgd.lib
				osgViewerd.lib
				osgDBd.lib						
				osgGAd.lib
				osgTextd.lib
				osgUtild.lib
				osgShadowd.lib
				osgSimd.lib
				osgManipulatord.lib
				OpenThreadsd.lib

				osgwToolsd.lib
				
				luad.lib
				
				
				#BulletCollision_debug.lib
				#BulletDynamics_debug.lib
				#HACD_debug.lib
				#LinearMath_debug.lib
				#osgbCollisiond.lib
				#osgbDynamicsd.lib
				#osgbInteractiond.lib
				#osgwToolsd.lib
				#SwigOsgToLuad.lib
				
				)
TARGET_LINK_LIBRARIES(${TARGET_NAME} debug "${ADDITIONAL_LIBRARIES_DEBUG}" optimized "${ADDITIONAL_LIBRARIES_RELEASE}")

set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/bin)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/bin)









